﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.PropertyTypes;

namespace Proggy.Web.Cms.Core.Configuration.ConfigObjects
{
    /// <summary>
    /// Config object for url selector
    /// </summary>
    public class UrlSelectorConfigObject : PropertyTypeConfigObjectBase
    {
        /// <summary>
        /// If true (which it is by default), external urls will be allowed to be added
        /// </summary>
        public bool AllowExternal
        {
            get
            {
                return this._allowExternal;
            }
            set
            {
                this._allowExternal = value;
            }
        }
        private bool _allowExternal = true;

        /// <summary>
        /// If true (which it is by default), internal urls will be allowed to be added
        /// </summary>
        public bool AllowInternal
        {
            get
            {
                return this._allowInternal;
            }
            set
            {
                this._allowInternal = value;
            }
        }
        private bool _allowInternal = true;

        /// <summary>
        /// If true (which it is by default), "mailto:" urls will be allowed to be added
        /// </summary>
        public bool AllowMailTo
        {
            get
            {
                return this._allowMailTo;
            }
            set
            {
                this._allowMailTo = value;
            }
        }
        private bool _allowMailTo = true;

        /// <summary>
        /// If true (which it is by default) requires each url to have a name
        /// </summary>
        public bool RequireName
        {
            get
            {
                return this._requireName;
            }
            set
            {
                this._requireName = value;
            }
        }

        private bool _requireName = true;

        /// <summary>
        /// If true (which it is by default) requires each url to have a title
        /// </summary>
        public bool RequireLinkTitle
        {
            get
            {
                return this._requireLinkTitle;
            }
            set
            {
                this._requireLinkTitle = value;
            }
        }

        private bool _requireLinkTitle = true;

        /// <summary>
        /// If true (which it is by default) requires each url to have a description
        /// </summary>
        public bool RequireDescription
        {
            get
            {
                return this._requireDescription;
            }
            set
            {
                this._requireDescription = value;
            }
        }
        private bool _requireDescription = true;


        /// <summary>
        /// If AllowInternal configure what internal content can be picked 
        /// IMPORTANT - MaxPages and MinPages MUST BE "1"
        /// </summary>
        public ContentPickerConfigObject ContentPickerConfigObject
        {
            get
            {
                return this._contentPickerConfigObject;
            }
            set
            {
                this._contentPickerConfigObject = value;
            }
        }
        private ContentPickerConfigObject _contentPickerConfigObject = new ContentPickerConfigObject
        {
            MaxPages = 1,
            MinPages = 1
        };

        /// <summary>
        /// If false, nothing is actually required! (For use in combined property types, defaults to true)
        /// </summary>
        public bool LinkIsMandatory { get { return this._linkIsMandatory; } set { this._linkIsMandatory = value; } }
        private bool _linkIsMandatory = true;
    }
}
